<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>删除页面上指定的p元素</title>
</head>
<body>
<div id="parentDiv">
    <p id="p1">JavaScript程序设计</p>
    <p>什么是JavaScript</p>
    <p>JavaScript是一门功能强大的编程语言</p>
    <p>第一部分是JavaScript概述</p>
    <p>JavaScript的发展史</p>
</div>
<button onclick="deleteP0()">删除p元素</button>

<script>
    function deleteP0() {
        var parentDiv = document.getElementById("parentDiv");
        var childP = document.getElementById("p1");
        parentDiv.removeChild(childP);
    }
</script>
</body>
</html>